<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>v-if和v-show</title>
  <style>
    .box1 {
      width: 200px;
      height: 100px;
      background-color: red;
    }

    .box2 {
      width: 200px;
      height: 100px;
      background-color: blue;
    }
  </style>
</head>

<body>
  <!-- 创建一个容器 -->
  <div id="app">
    <div class="box1" v-if="isShow">用v-if控制</div>
    <div class="box2" v-show="isShow">用v-show控制</div>

    <button @click="isShow=!isShow">切换</button>
  </div>


  <script src="./js/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        isShow: false
      }
    })
  </script>
</body>

</html>